﻿using System;
using System.Collections;
using System.Data;

public partial class SlideAnh : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Data data = new Data();
        DataTable tableAnhChay = data.GetTable_By_Name("AnhChay");
        string[] TopAnhChayImage = new string[5];
        string[] TopAnhChayLink = new string[5];
        string[] TopAnhChayTieuDe = new string[5];
        string[] TopAnhChayTieuDeTomTat = new string[5];
        for (int i = 0; i < tableAnhChay.Rows.Count; i++)
        {
            TopAnhChayImage[i] = tableAnhChay.Rows[i]["AnhChayImage"].ToString();
            TopAnhChayLink[i] = tableAnhChay.Rows[i]["AnhChayLink"].ToString();
            TopAnhChayTieuDe[i] = tableAnhChay.Rows[i]["AnhChayTieuDe"].ToString();
            TopAnhChayTieuDeTomTat[i] = tableAnhChay.Rows[i]["AnhChayTieuDeTomTat"].ToString();
        }
        for (int i = 0; i < 5; i++)
        {
            ltlSlideAnh.Text += "<img src='Images/AnhChay/" + TopAnhChayImage[i] + "' alt='' width=690 height=310 ><a href='" + TopAnhChayLink[i] + "'></a>";
        }
       
    }
}
